import {hrAjax as proFetch} from "src/hrpub/common/utils/utils";

export default function getSysConf(orgValue, key) {
    if (!key) {
        key = orgValue && orgValue.refpk ? 'HRKQ001' : 'HRKQ004'
    }
    return new Promise((resolve, reject) => {
        proFetch({
            url: '/nccloud/hrhi/sysparam/SysInitParamPubQueryAction.do',
            body: {
                pk_org: orgValue && orgValue.refpk,
                sysPrarms: key
            },
            loading: false,
            error: () => {
            }
        }).then(res => {
            resolve(Number(res.data && res.data[key]) || 50)
        }).catch(err => {
            resolve(50)
        })
    })
}
